package com.yeyks.common.em;

/**
 * @author fuchangshuai
 * @date 2019/4/25 0025
 */
public enum FishBallEnum {
    SIGN(1, "签到获取鱼宝"),
    COMMIT(2, "评论成功获取鱼宝"),
    GOODS(3, "兑换商品券");

    int value;
    String desc;

    FishBallEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer value() {
        return this.value;
    }

    public String desc() {
        return this.desc;
    }

    public static String getDesc(int value) {
        FishBallEnum[] fishBallEnums = values();
        for (FishBallEnum fishBallEnum : fishBallEnums) {
            if (fishBallEnum.value() == value) {
                return fishBallEnum.desc();
            }
        }
        return null;
    }

    public static Integer getValue(String desc) {
        FishBallEnum[] fishBallEnums = values();
        for (FishBallEnum fishBallEnum : fishBallEnums) {
            if (fishBallEnum.desc().equals(desc)) {
                return fishBallEnum.value();
            }
        }
        return null;
    }
}
